package com.briup.estore.result;

import static org.hamcrest.CoreMatchers.nullValue;

public class Res {

	public static Result success() {
		return new Result(ResCode.CODE_SUCCESS, null, "success!");
	}

	public static Result success(String msg) {
		return new Result(ResCode.CODE_SUCCESS, null, msg);
	}

	public static Result success(Object object) {
		return new Result(ResCode.CODE_SUCCESS, object, "success!");
	}

	public static Result success(Object object, String msg) {
		return new Result(ResCode.CODE_SUCCESS, object, msg);
	}

	public static Result failure() {
		return new Result(ResCode.CODE_FAILURE, null, "failure!");
	}

	public static Result failure(String msg) {
		return new Result(ResCode.CODE_FAILURE, null, msg);
	}

	public static Result failure(Object object) {
		return new Result(ResCode.CODE_FAILURE, object, "failure!");
	}

	public static Result failure(Object object, String msg) {
		return new Result(ResCode.CODE_FAILURE, object, msg);
	}

	public static Result extResult(int code, Object object, String msg) {
		return new Result(code, object, msg);
	}
}
